package com.huan.rabbitmq.callback;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

import lombok.extern.slf4j.Slf4j;

/**
 * 有关消息被退回来的具体描述消息
 * @ClassName: RabbitReturnCallback
 * @Description: 
 * @Author lyt
 * @DateTime 2020年5月7日 下午3:14:11
 */
@Slf4j
public class RabbitReturnCallback implements RabbitTemplate.ReturnCallback{

	
	@Override	
	public void returnedMessage(Message message, 
								int replyCode, 
								String desc, 
								String exchangeName, 
								String routeKey) {
		log.info("err code:[{}]", replyCode);
		log.info("错误消息的描述:[{}]", desc);
		log.info("错误的交换机是 :[{}]", exchangeName);
		log.info("错误的路由键是  :[{}]", routeKey);
		log.info("错误的消息体是  :[{}]", message.getBody());
	}

	
}
